/******************************************************************************/
//	DxImage.h	-	Loads graphics as D3D Textures
//
//	Author:		Russell Klinkerman
//	Created:	09.02.2004
//
/******************************************************************************/

#ifndef _DXIMAGE_H_
#define _DXIMAGE_H_

#include "Direct3DManager.h"

class	CDxImage
{
	private:

		LPDIRECT3DTEXTURE9	pTexture;		//	A texture interface pointer.
		D3DXIMAGE_INFO		dxImageInfo;	//	The texture's info (width, height,...)

	public:

		/******************************************************************************/
		//	Load	-	Loads an image file onto a D3D texture
		//					( Supports: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga )
		//
		//	In:			szFile		- The filename of the image to be loaded
		//				dxColorKey	- A color to be keyed out with displaying the texture.
		//								(use D3DCOLOR_XRGB() macro)
		//	Return:	TRUE if successful
		/******************************************************************************/
		bool	Load(char *	szFile, D3DCOLOR dxColorKey);

		/******************************************************************************/
		//	Unload	-	Releases any allocated texture
		/******************************************************************************/
		void	Unload();

		// Accessors
		LPDIRECT3DTEXTURE9	GetTexture()	{ return pTexture; }
		unsigned int		GetWidth()		{ return dxImageInfo.Width; }
		unsigned int		GetHeight()		{ return dxImageInfo.Height; }

};

#endif